<?php

namespace Acme\PinnwandBundle\Entity;

use Acme\UserBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;

/**
 * Acme\PinnwandBundle\Entity\Pinnwand
 *
 * @ORM\Table(name="pinnwands")
 * @ORM\Entity(repositoryClass="Acme\PinnwandBundle\Entity\PinnwandRepository")
 */
class Pinnwand {
	
	/**
	 * @ORM\Column(type="integer")
	 * @ORM\Id
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	private $id;
	
	/**
	 * @ORM\Column(type="text")
	 */
	private $text;
	
	/**
	 * @ORM\Column(type="text")
	 */
	private $image;
	
	/**
	 * @ORM\Column(type="datetime")
	 */
	private $created_at;
	
	/**
	 * @ORM\Column(type="integer")
	 */
	private $group_id;
	
	/**
	 * @ORM\ManyToMany(targetEntity="\Acme\UserBundle\Entity\User", mappedBy="pinnwands")
	 */
	protected $users;
	
	/**
	 * Constructor
	 */
	public function __construct() {
		$this->users = new \Doctrine\Common\Collections\ArrayCollection ();
	}
	
	/**
	 * Get id
	 *
	 * @return integer
	 */
	public function getId() {
		return $this->id;
	}
	
	/**
	 * Set text
	 *
	 * @param string $text        	
	 * @return Pinnwand
	 */
	public function setText($text) {
		$this->text = $text;
		
		return $this;
	}
	
	/**
	 * Get text
	 *
	 * @return string
	 */
	public function getText() {
		return $this->text;
	}
	
	/**
	 * Set created_at
	 *
	 * @param \DateTime $createdAt        	
	 * @return Pinnwand
	 */
	public function setCreatedAt($createdAt) {
		$this->created_at = $createdAt;
		
		return $this;
	}
	
	/**
	 * Get created_at
	 *
	 * @return \DateTime
	 */
	public function getCreatedAt() {
		return $this->created_at;
	}
	
	/**
	 * Set group_id
	 *
	 * @param integer $groupId        	
	 * @return Pinnwand
	 */
	public function setGroupId($groupId) {
		$this->group_id = $groupId;
		
		return $this;
	}
	
	/**
	 * Get group_id
	 *
	 * @return integer
	 */
	public function getGroupId() {
		return $this->group_id;
	}
	
	/**
	 * Add users
	 *
	 * @param \Acme\UserBundle\Entity\User $users        	
	 * @return Pinnwand
	 */
	public function addUser(\Acme\UserBundle\Entity\User $users) {
		$this->users [] = $users;
		
		return $this;
	}
	
	/**
	 * Remove users
	 *
	 * @param \Acme\UserBundle\Entity\User $users        	
	 */
	public function removeUser(\Acme\UserBundle\Entity\User $users) {
		$this->users->removeElement ( $users );
	}
	
	/**
	 * Get users
	 *
	 * @return \Doctrine\Common\Collections\Collection
	 */
	public function getUsers() {
		return $this->users;
	}
	
	/**
	 * Set image
	 *
	 * @param string $image        	
	 * @return Pinnwand
	 */
	public function setImage($image) {
		$this->image = $image;
		
		return $this;
	}
	
	/**
	 * Get image
	 *
	 * @return string
	 */
	public function getImage() {
		return $this->image;
	}
}